package com.zzyl.nursing.controller.member;

import com.zzyl.common.core.controller.BaseController;
import com.zzyl.common.core.domain.R;
import com.zzyl.common.core.page.TableDataInfo;
import com.zzyl.nursing.service.IMemberOrdersService;
import com.zzyl.serve.domain.NursingProject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 服务项相关接口
 */
@RestController
@RequestMapping("/member/orders/project")
@Api(tags = "服务项相关接口")
public class MemberOrders extends BaseController {
    @Autowired
    private IMemberOrdersService memberOrdersService;
    @GetMapping("/page")
    @ApiOperation(value = "获取服务项列表")
    public TableDataInfo<List<NursingProject>> page(String name,
                              Integer pageNum,
                              Integer pageSize,
                              Integer  status){
        List<NursingProject> result = memberOrdersService.page(name,pageNum,pageSize,status);
        return getDataTable(result);
    }
    @GetMapping("/{id}")
    public R<NursingProject> getInfo(@PathVariable Long id){
        return R.ok(memberOrdersService.getInfo(id));
    }
}
